<?php
if(!isset($params))
  $params = array();
  
if(!isset($page_param))
{
  $page_param = 'page';  
}
?>
<?php if (sizeof(@$pager->getLinks()) > 1): ?>
      <div class="paging_button">
        <?php if ($sf_context->getRequest()->getParameter($page_param, 1) != 1): ?>
        <?php echo link_to('Đầu tiên', urlToPage($sf_context, $pager->getFirstPage(), $params,$page_param)); ?>
        <?php echo link_to('Quay lại', urlToPage($sf_context, $pager->getPreviousPage(), $params,$page_param)); ?>
        <?php endif; ?> 
        <?php foreach ($pager->getLinks() as $pageNumber): ?>
        <?php if($sf_context->getRequest()->getParameter($page_param, 1)==$pageNumber): ?>  
          <?php echo link_to($pageNumber, urlToPage($sf_context, $pageNumber, $params,$page_param),array('id'=>'paging_button_current')); ?>
        <?php else: ?>
          <?php echo link_to($pageNumber, urlToPage($sf_context, $pageNumber, $params,$page_param)); ?>
        <?php endif; ?>        
      <?php endforeach; ?>
      <?php if ($sf_context->getRequest()->getParameter($page_param, 1) != $pager->getLastPage()): ?>
        <?php echo link_to('Tiếp tục', urlToPage($sf_context, $pager->getNextPage(), $params,$page_param)); ?>
        <?php echo link_to('Cuối cùng', urlToPage($sf_context, $pager->getLastPage(), $params,$page_param)); ?>
      <?php endif; ?>
    </div>
<?php endif; ?>